package com.crm.base.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.crm.base.domain.Menu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-07-14
 */

@Mapper
public interface MenuMapper extends BaseMapper<Menu> {

    @Select("SELECT * FROM t_menu WHERE MID IN (SELECT MID FROM t_user_role ur JOIN t_role_menu rm ON ur.rid = rm.rid WHERE ur.uid =#{uid})")
    List<Menu> findMenus(Long uid);

}
